// 图色
package lwsoft

import "fmt"

//FindPicY 这个函数可以查找多个图片,找到其中任何一张就返回,
func (com *LwSoft) FindPicY(x1, y1, x2, y2 int, picName, deltaColor string, sim float32, dir, timeout, ischick, chickdex, chickdey, chickdely int) int {
	ret, _ := com.lw.CallMethod("FindPic", x1, y1, x2, y2, picName, deltaColor, sim, dir, timeout, ischick, chickdex, chickdey, chickdely)
	fmt.Println(ret)
	return int(ret.Val)
}

//FindPic 这个不加鼠标的动作，这个函数可以查找多个图片,找到其中任何一张就返回
func (com *LwSoft) FindPic(x1, y1, x2, y2 int, picName, deltaColor string, sim float32, dir int) int {
	ret, _ := com.lw.CallMethod("FindPic", x1, y1, x2, y2, picName, deltaColor, sim, dir)
	fmt.Println(ret)
	return int(ret.Val)
}

//FindPicK 这个不加鼠标的动作，并且向外围扩大10个像素，这个函数可以查找多个图片,找到其中任何一张就返回
func (com *LwSoft) FindPicK(x1, y1, x2, y2 int, picName, deltaColor string, sim float32, dir, bs int) int {
	bs = bs * 10
	x1 = x1 - bs
	y1 = y1 - bs
	x2 = x2 + bs
	y2 = y2 + bs
	ret, _ := com.lw.CallMethod("FindPic", x1, y1, x2, y2, picName, deltaColor, sim, dir)
	fmt.Println(ret)
	return int(ret.Val)
}

//FindPicEx
func (com *LwSoft) FindPicEx(x1, y1, x2, y2 int, picName, deltaColor string, sim float32, dir int) string {
	ret, _ := com.lw.CallMethod("FindPicEx", x1, y1, x2, y2, picName, deltaColor, sim, dir)
	return ret.ToString()
}

//FindMultiColor 根据指定的多点查找颜色坐标,找到返回1,没找到返回0,本函数会设置x,y,idx.
func (com *LwSoft) FindMultiColor(x1, y1, x2, y2 int, firstColor, offsetColor string, sim float32, dir int) int {
	ret, _ := com.lw.CallMethod("FindMultiColor", x1, y1, x2, y2, firstColor, offsetColor, sim, dir)
	fmt.Println(ret)
	return int(ret.Val)
}
